#include <iostream>
using namespace std;

int b[100001];
int N, C;
void myqsort(int left, int right)
{
            int i, j, key;
            i = left;
            j = right;
            key = b[(left+right)/2];
            while (i < j){
                  while (b[i]<key) i++;
                  while (b[j]>key) j--;
                  if (i<=j){
                     swap(b[i],b[j]);
                     i++;
                     j--;
                  }
            }
            if (i < right) myqsort(i,right);
            if (j > left) myqsort(left,j);
}

int inp(int dis)
{
	int i, tot, count;

	count = 1;
	for (i=2, tot=0; i<=N && count<C; ++i)
	{
		tot += b[i] - b[i-1];
		if ( tot >= dis )
		{
			count++;
			tot=0;
		}
	}
	if (count==C) return 1;
	return 0;
}



int inpx(int k)
{
    int num, now, i, key;
    num = 1;
    now = b[1];
    key = 0;
    while (num < C && key != 1){
          now = now + k;
          for (i = 2; i <= N; i++ )
              if (b[i] >= now){
                 num++;
                 now = b[i];
                 break;
              }
              else
                  if (i == N)
                     key = 1; 
    }
    if (key == 0) 
       return 1;
    else
        return 0;
}
int main(){
    int i, key, left, right;
    cin>>N>>C;
    for (i=1; i <= N; i++)
        cin>>b[i];
    myqsort(1,N);
    key = b[N]/2;
    left = 0;
    right = b[N];
    int ans;
    ans = 0;
//    cout << inp(3) << endl;
    while (left <= right){
          key = (left + right)/2;
          if (inp(key) == 1){
             if (ans < key) ans = key;
             left = key + 1;
          } 
          else
            right = key -1;
    }
    cout<<ans;
//    system ("pause");
    return 0;
}
